package com.ruoyi.project.order.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.order.domain.BinsOrder;
import com.ruoyi.project.order.domain.BinsOrderStt;
import com.ruoyi.project.order.service.IOrderStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @title : OrderStatController
 * @Author : Administrator
 * @Date : 2025/4/1
 * @Version : 1.0.0
 * @Description : 订单统计
 */
@RestController
@RequestMapping("/order/stat")
public class OrderStatController extends BaseController {

    @Autowired
    IOrderStatService orderStatService;


    @GetMapping("/byMarch")
    public TableDataInfo getOrderStatByMarch(BinsOrderStt orderStt){
        if (orderStt.getDeptId() == null) {
            orderStt.setDeptId(getCommonDeptId());
        }
        List<Map> list = orderStatService.getOrderStatByMarch(orderStt);
        return getDataTable(list);
    }

}
